package com.eastcom.dataquality.ds;

import java.util.concurrent.BlockingQueue;

import com.eastcom.dataquality.core.dao.DaoFactory;
import com.eastcom.dataquality.core.module.Atom_SmoothDefine;
import com.eastcom.dataquality.core.module.Atom_SmoothEvent;

public class EventBeanManager extends Thread {

	protected BlockingQueue<Atom_SmoothEvent> eventQueue;
	
	private SmoothCenter smoothCenter;
	
	public void init(){
		this.start();
	}
	
	public void run(){
		while(true){
			try {
				Atom_SmoothEvent event=eventQueue.take();
				smoothCenter.addEvent(event);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

	/*
	 * get/set
	 * */
	public BlockingQueue<Atom_SmoothEvent> getEventQueue() {
		return eventQueue;
	}

	public void setEventQueue(BlockingQueue<Atom_SmoothEvent> eventQueue) {
		this.eventQueue = eventQueue;
	}

	public SmoothCenter getSmoothCenter() {
		return smoothCenter;
	}

	public void setSmoothCenter(SmoothCenter smoothCenter) {
		this.smoothCenter = smoothCenter;
	}
}
